package com.beta.em;

import java.util.Arrays;

/**
 * Created by vector on 2016/11/17.
 */
public enum ConfirmCodeType {

    REGIST("regist", "用户注册"),
    RESET("reset", "重置密码");

    private String value;

    private String cnValue;

    ConfirmCodeType(String value, String cnValue) {
        this.value = value;
        this.cnValue = cnValue;
    }

    public String getValue() {
        return this.value;
    }

    public String getCnValue() {
        return this.cnValue;
    }

    public static ConfirmCodeType getType(String value) {
        return Arrays.stream(ConfirmCodeType.values()).filter(type -> type.getValue().equals(value)).findFirst().orElse(null);
    }

}
